#pragma once

#include <iostream>
#include <angelscript.h>




namespace Engine
{
	namespace Script
	{
		class BinaryStream
			: public asIBinaryStream
		{
		public:

			BinaryStream(std::basic_istream<char>& istream);
			BinaryStream(std::basic_ostream<char>& ostream);
			BinaryStream(std::basic_iostream<char>& iostream);
			virtual ~BinaryStream();



			bool can_read() const;
			bool can_write() const;



			void Read(void* ptr, asUINT length);
			void Write(const void* ptr, asUINT length);

		private:

			std::basic_istream<char>*    m_istream;
			std::basic_ostream<char>*    m_ostream;
		};
		///////////////////////////////////////////////////////////////////////////////////////////
	}
	///////////////////////////////////////////////////////////////////////////////////////////////
}
///////////////////////////////////////////////////////////////////////////////////////////////////
